{% extends "iphone/base.html" %}

{% block extrahead %}
	<script type='text/javascript' src='/appmedia/js/jquery_min.js'></script>
    <script language="JavaScript" type="text/javascript">
   	function CheckPassword2() {
   		var password = document.getElementById("password").value;
   		var password2 = document.getElementById("password2").value;
   		var password_good2 = document.getElementById("password_good2");
    		
   		if (password2 != password) {
  			password_good2.innerHTML = '<img src="/appmedia/icon-no.gif">';
   		}
   		else {
   			password_good2.innerHTML = '<img src="/appmedia/icon-yes.gif">';
   		}
  	}
  	
  	function check_login() {
		new_login = $("#id_username").val();
		if (new_login == "") {
			$("#login_status").html("<b style='color:blue'>Please, type in your login</b>");
			return;
		}
		$.post("/check_login/", {"login": new_login}, function(data){$("#login_status").html(data);});
	
	}
    </script>
{% endblock %}

{% block title %}
- Registration
{% endblock %}

{% block content %}
<div class="header">Registration :: <a href="/iphone/">Main page</a></div>
<br />
{% if error_message %}
<div class="undo">{{ error_message }}</div>
{% endif %}
<form id="Registration" action="/iphone/registration/" method="post">
Choose a username:<br />
<input name="username" id="id_username" type="text" />
<a href="javascript:check_login()">Check availability!</a>
<br />
<div id="login_status">
</div>
<span class="info">Use alphanumeric characters only (letters, digits and underscores).</span>
<br />
<br />

Choose a password:<br />
<input id="password" name="password" type="password" onkeyup="CheckPassword2()" /><br />
Type password again:<br />
<input type="password" id="password2" name="password2" onkeyup="CheckPassword2()" />
<div id="password_good2" style="display:inline"></div>
<br />

<span class="info">Password must be more than 6 characters in length.</span><br />
<br />

By using the gettingtasksdone.com web site, you are agreeing to be bound by the 
<a href="/iphone/terms/">Terms of Service</a>.
<br />
<br />
<input type="submit"value="I accept. Create account." />
</form>
{% endblock %}
